From bc5d7734b36e0ae535231cda3b74061abeccfb4c Mon Sep 17 00:00:00 2001 From: "cl349@firebug.cl.cam.ac.uk" Date: Mon, 20 Feb 2006 23:01:50 +0000 Subject: [PATCH] linux-i386: Fix CONFIG_X86_NO_TSS and CONFIG_X86_SYSENTER. Signed-off-by: Christian Limpach --- linux-2.6-xen-sparse/arch/i386/kernel/cpu/common-xen.c | 2 +- .../include/asm-i386/mach-xen/asm/processor.h | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/linux-2.6-xen-sparse/arch/i386/kernel/cpu/common-xen.c b/linux-2.6-xen-sparse/arch/i386/kernel/cpu/common-xen.c index 4d646fe16f..1065f4160a 100644 --- a/linux-2.6-xen-sparse/arch/i386/kernel/cpu/common-xen.c +++ b/linux-2.6-xen-sparse/arch/i386/kernel/cpu/common-xen.c @@ -595,7 +595,7 @@ void __cpuinit cpu_gdt_init(struct Xgt_desc_struct *gdt_descr) void __cpuinit cpu_init(void) { int cpu = smp_processor_id(); -#ifdef CONFIG_DOUBLEFAULT +#ifndef CONFIG_X86_NO_TSS struct tss_struct * t = &per_cpu(init_tss, cpu); #endif struct thread_struct *thread = ¤t->thread; diff --git a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/processor.h b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/processor.h index 8ff4c15cb9..1e72f53e12 100644 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/processor.h +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/processor.h @@ -503,15 +503,19 @@ struct thread_struct { .io_bitmap = { [ 0 ... IO_BITMAP_LONGS] = ~0 }, \ } -static inline void load_esp0(struct tss_struct *tss, struct thread_struct *thread) +static inline void __load_esp0(struct tss_struct *tss, struct thread_struct *thread) { tss->esp0 = thread->esp0; +#ifdef CONFIG_X86_SYSENTER /* This can only happen when SEP is enabled, no need to test "SEP"arately */ if (unlikely(tss->ss1 != thread->sysenter_cs)) { tss->ss1 = thread->sysenter_cs; wrmsr(MSR_IA32_SYSENTER_CS, thread->sysenter_cs, 0); } +#endif } +#define load_esp0(tss, thread) \ + __load_esp0(tss, thread) #else #define load_esp0(tss, thread) \ HYPERVISOR_stack_switch(__KERNEL_DS, (thread)->esp0) -- 2.30.2